package com.town.pojo;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

//@component（组件） 等价于<bean id="user" class="com.monkey.pojo.User"/>

public class User {
    //相当于<property name="name" value="monkey"/>

    public String name;

    public User() {
    }

    public User(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Value("糖水")
    public void setName(String name) {
        this.name = name;
    }
}